Text Area Extensions

The API for text area extensions is still the same, however you must make sure your plugin correctly adds itself to existing text areas when it is loaded after jEdit startup, and that it removes itself from open views if it is unloaded before jEdit exits.

A new method was added to the TextAreaExtension class:

void paintScreenLineRange(Graphics2D  gfx,
 int  firstLine,
 int  lastLine,
 int[]  physicalLines,
 int[]  start,
 int[]  end,
 int  y,
 int  lineHeight);

See the class documentation for information on each parameter.

You can override this method to paint a range of lines at once, instead of having to respond to each individual paintValidLine() and paintInvalidLine call.

While for many text area extensions using this method will result in no speedup, some like the error highlight in the ErrorList plugin become more efficient. The error highlight searches an array each time it has to paint a line. Previously the array was searched for each line painted in screen. Using this method, it is possible to search the array only once when painting a range of lines.